package com.dyb.comm.config;

import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName : MinioConfig
 * @Description :
 * @Author : LinYa
 * @Date: 2022/6/23  10:55
 */

@Configuration
public class MinioConfig {

	@Autowired
	private MinioProperties minioProperties;

	@Bean
	public MinioClient minioClient(){
		MinioClient	minioClient = MinioClient.builder()
				.endpoint(minioProperties.getEndpoint())
				.credentials(minioProperties.getAccessKey(), minioProperties.getSecretKey())
				.build();
		return minioClient;
	}

}
